﻿@model List<BlogInfoViewModel>
@{
    ViewData["Title"] = "嗨-博客";
}
<link href="~/Resource/Home/Index.css" rel="stylesheet" />
<div>
    <div class="hiLabel">
        <div style="margin-top:10px;">
            <a target="_blank" href="//github.com/zhaopeiym/Hi-Blogs">
                <img src="~/images/github.jpg" />
            </a>
        </div>
    </div>

    <nav class="navbar clearfix">
        <div class="navbar-left">
            <a href="//haojima.net" class="navbar-brand">
                嗨-博客
            </a>
            <span class="mesg">ASP.NET Core2.0 + CentOS7.3 只为技术而技术！！！</span>
        </div>
        <div class="navbar-right">
            @*
                <a target="_blank" href="//job.haojima.net">找工作（实时综合查询）</a>
                <a target="_blank" href="//socket.haojima.net">聊天室</a>
            *@
            @if (User.Identity.IsAuthenticated)
            {
                <span>@ViewBag.userNickname</span>
                <button class="btn-logoff">安全退出</button>
            }
            else
            {
                <a href="/Admin/Account/Login?ReturnUrl=/">登录</a>
            }
            <a>写文章</a>
            <a target="_blank" href="//messageboard.haojima.net">留言板</a>
        </div>
        <div class="navbar-right-phone displayNone">
            <a target="_blank" href="//job.haojima.net">找工作</a>
            <a target="_blank" href="//socket.haojima.net">聊天室</a>
            <a target="_blank" href="//messageboard.haojima.net">留言板</a>
        </div>
    </nav>
    <div class="blogList">
        <ul>
            @foreach (var blogInfo in Model)
            {
                <li><a target="_blank" href="/Home/Blog/@blogInfo.Id">@blogInfo.Title</a></li>
            }
        </ul>
    </div>
    <div class="footer">
        <a target="_blank" href="//job.haojima.net">找工作（实时综合查询）</a>
        <a target="_blank" href="//socket.haojima.net">聊天室</a>
        <a target="_blank" href="//i.haojima.net/">爱收藏</a>
    </div>
</div>
@section scripts{
    <script type="text/javascript">
        $(".btn-logoff").click(function () {
            $.ajax({
                url: "/api/Account/LogOff",
                type: "post",
                success: function (sData) {
                    location.reload(true);
                }
            });
        });
    </script>
}